	noRedirectMatrix = true;
	var lastFieldId = '';
	var lastBgColor = '';
	var updateStatus = true;
	var lastFieldTxt = true;
    var rowMod;
	var dayMod;	

		function followLink(strURL)
		{
		if (getUpdateStatus()) 
			window.location = strURL;
		}		

		function checkArrows(day, row, field, projectref, mainref, evt) 
		{
		  rowMod = row;
		  dayMod = day;	
		  obj = document.getElementById('tOff_' + day + '_' + row);	
		  var keyCode = document.layers ? evt.which : document.all ? event.keyCode : document.getElementById ? evt.keyCode : 0;
 		 
 		  if (keyCode == 123)
			{
			  if (day > 0) 	
				  objNext = document.bodyFormA.txt;
			  else	
				  objNext = eval('document.bodyFormA.d_' + lastFieldId);					
			  objNext.focus();			
		  	  objNext.select();			
			}
		  else if ( day > 0 )
			{
			  if (keyCode == 39) //Move right
				if ( day == 7 ) 
				{
				    if (row == icheckBodyFormA)
						rowMod = 1;
					else
						rowMod = row + 1;
				    
				    dayMod = 1;
				    
				rowMod = rowModHidden(1, dayMod, rowMod, 1);


				}

				else
				    dayMod = day + 1;
			  else if (keyCode == 40) //Move down
				{
					if ( row == icheckBodyFormA )
					{
						rowMod = 1;
						if ( day == 7 )
							dayMod = 1;
						else
							dayMod = day + 1;
					}
					else
						rowMod = row + 1;

				rowMod = rowModHidden(2, dayMod, rowMod, 1);
			}


			  else if (keyCode == 38) //Move up
				{
				if ( row == 1 )
					rowMod = icheckBodyFormA;
				else
				    rowMod = row - 1;

				rowMod = rowModHidden(3, dayMod, rowMod, -1);

				}

			  else if (keyCode == 37) //Move left
				if ( day == 1 )
				{
				    if (row == 1)
						rowMod = icheckBodyFormA;
					else
						rowMod = row - 1;
				    dayMod = 7;
					
				rowMod = rowModHidden(4, dayMod, rowMod, -1);
				}
				else
					dayMod = day - 1;
			  					
			  if (day != dayMod || row != rowMod)
			  {
				objNext = eval('document.bodyFormA.d_' + dayMod + '_' + rowMod);
			  	objNext.focus();		
			  }
			}
		}
		
		function f_setfocus( aForm )
		{
			if( aForm.elements[0]!=null ) {
				var i;
				var max = aForm.length;
				for( i = 0; i < max; i++ ) {
					objParent = aForm.elements[ i ].parentElement;
					objGrandParent = objParent.parentElement
					if( aForm.elements[ i ].type != "hidden" && !aForm.elements[ i ].disabled && !aForm.elements[ i ].readOnly && objGrandParent.style.display == "") {
						aForm.elements[ i ].focus();
				  	    aForm.elements[ i ].select();				
						break;
					}
				}
			}
		}

		function rowModHidden(control, day, rowMod, direction)
		{

			var rowModAd = rowMod - 1;

			var objRow = document.getElementById('menu_' + rowModAd);

			while(objRow.style.display == 'none')
			{
				if (rowMod == 1 && direction == -1)
				{
					rowMod = icheckBodyFormA;
					if ( day == 1 && control > 1 && control < 4)
						dayMod = 7;
					else		
						dayMod = day - 1;				

					rowModAd = rowMod
				
				}
				else if(rowMod == icheckBodyFormA && direction == 1)
				{
					rowMod = 1;
					if ( day == 7 && control > 1 && control < 4)
						dayMod = 1;
					else		
						dayMod = day + 1;				

					rowModAd = rowMod
				}
				else
					rowMod = rowMod + direction;

				rowModAd = rowMod - 1;

				objRow = document.getElementById('menu_' + rowModAd);

			}		
	
			return rowMod
		}

{ 
self.name="BODY"; 
var x = 0, y = 0;
} 
function datePick(lnk,deltaX,deltaY) 
{
y = window.screenTop;
x = window.screenLeft ;
window.open(lnk,'','height=205,width=170,scrollbars=no,left='+(x+deltaX)+',top='+(y+deltaY)); 
} 
